package com.atguigu.gulimall.product.stream;

import org.junit.Test;

import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
import java.util.stream.Stream;

public class StreamDemo1 {

    @Test
    public void test1(){
        List<String> players = Arrays.asList("kobe", "james", "curry", "cyyt");

        String[] player = {"kobe", "james", "curry", "cyyt"};
        //Stream.of(player).filter().map()
        Set<String> set = new HashSet<>(players);
        List<String> after = players.stream()
                .filter(s -> s.startsWith("c"))
                .map(String::toUpperCase)
                .sorted()
                .collect(Collectors.toList());
        System.out.println(after);
    }
    }

